package com.koron.common.core.business.workflow.feign;

import com.koron.bean.base.Response;
import com.koron.common.core.business.workflow.bean.po.ConfigureWorkflow;
import com.koron.common.core.business.workflow.bean.properties.WorkflowPlugin;
import com.koron.common.core.business.workflow.bean.properties.WorkflowProperties;
import com.koron.common.core.feignConfig.FeignFallbackFactory;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 查询流程配置
 * @author jzp
 * @since 2021/10/28
 */
@Service
@FeignClient(value = "eam-service-configure", fallbackFactory = FeignFallbackFactory.class)
public interface ConfigureFeignService {
    /**
     * 查询交接班配置list
     * @param processCode processCode
     */
    @GetMapping("/configureWorkflow/inner/workflowProperties")
    Response<WorkflowProperties> getWorkflowProperties(@RequestParam("processCode") String processCode);

    /**
     * 查询流程配置list
     * @param processCode processCode
     * @param nodeCode nodeCode
     * @param type
     *      0 选人组件过滤
     *      1 节点出口人员过滤
     *      2 节点入口人员过滤
     * @return WorkflowPlugin
     */
    @GetMapping("/configureWorkflow/inner/workflowPlugin")
    Response<WorkflowPlugin> getPluginUrlByNode(@RequestParam("processCode") String processCode,
                                                @RequestParam("nodeCode") String nodeCode,
                                                @RequestParam("type") Integer type);

    @ApiOperation(value = "获取工作流模板组字典")
    @GetMapping("/configureWorkflow/setCodes")
    Response<List<ConfigureWorkflow>> setCodes(@RequestParam("appCode") String appCode);

}
